var ClubMessageItem = Item.extend({
    _ccsFileName: res.ClubMessageItem_json,
    _messagData: null,
    initItem: function () {

    },
    onEnter: function () {
        Item.prototype.onEnter.call(this);
        this._addClickListeners();
    },

    _initClickListeners: function () {
        this._clickListeners = {
            'btn_jujue': '_clickRefuse',
            'btn_tongyi': '_clickAgree',
        }
    },

    refreshData: function (idx, messagData) {
        this._messagData = messagData;

        this._nodeList['lb_num'].setString(idx);
        this._nodeList['lb_name'].setString(ellipsisStr(messagData['name'], 6));
        this._nodeList['time'].setString(messagData['create_time']);
        this._nodeList['lb_id'].setString(ellipsisStr(messagData['clubname'], 6) + '（ID:' + messagData['club_id'] + '）');
        loadImageToSprite(decodeURIComponent(messagData['head']), this._nodeList['head'], true);
        cc.log('消息数据:' + JSON.stringify(messagData));
    },

    _clickRefuse: function () {
        network.send(2103, {
            cmd: ClubMsgCode.AgreeClub, club_id: this._messagData.club_id, obj_id: gameData.uid,
            msg_id: this._messagData['_id'], value: 'reject'
        });
    },

    _clickAgree: function () {
        network.send(2103, {
            cmd: ClubMsgCode.AgreeClub, club_id: this._messagData.club_id, obj_id: gameData.uid,
            msg_id: this._messagData['_id'], value: 'accept'
        });
    },
});